home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connectio…eloper Series 2005 March / Dev.CD Mar 05.iso / What's New / Technical Notes and Q&As / ADC Reference Library / technotes / tn2002 / downloads / tn2076.sit / HelloIOKitwithPowerManagement / HelloIOKitwithPowerManagement.h < prev   
Encoding:
C/C++ Source or Header  |  2003-06-16  |  897 b   |  25 lines

  1. #include <IOKit/IOService.h>
  2. // this is the power state array
  3. // two states = on/off
  4.     enum {
  5.     kDTSOffState = 0,    //off
  6.     kDTSOnState = 1,    //on
  7.     kNumDTSStates = 2    //number of states
  8.     };
  9.     static const IOPMPowerState ourPowerStates[kNumDTSStates] = {
  10.     {kIOPMPowerStateVersion1,0,0,0,0,0,0,0,0,0,0,0},
  11.     {kIOPMPowerStateVersion1,kIOPMDeviceUsable,IOPMPowerOn,IOPMPowerOn,0,0,0,0,0,0,0,0}
  12.     };
  13.     
  14. class com_DTS_driver_HelloIOKitwithPowerManagement : public IOService
  15. {
  16. OSDeclareDefaultStructors(com_DTS_driver_HelloIOKitwithPowerManagement);
  17. public:
  18. virtual bool init(OSDictionary *dictionary = 0);
  19. virtual void free(void);
  20. virtual IOService *probe(IOService *provider, SInt32 *score);
  21. virtual bool start(IOService *provider);
  22. virtual void stop(IOService *provider);
  23. // override your providers setPowerState method
  24. virtual IOReturn setPowerState(unsigned long, IOService *);
  25. };